/*interface Usb {
    int a = 10;
    int b = 10;
    default void mo(){
        System.out.println("默认方法");
    }
    void usb();
}
class A implements Usb{
    @Override
    public void usb() {
        System.out.println("电脑使用");
    }
}
class B implements Usb{
    @Override
    public void usb() {
        System.out.println("手机使用");
    }
}*/


/*class Animal{
    String name;

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public Animal(*//*String name*//*){
       *//* this.name = name;*//*
    }
    public void eat(){
        System.out.println(this.name + "正在吃");
    }
}
interface IFly{
    void fly();
}
interface IRun{
    void run();
}
interface  ISwim{
    void swim();
}
class Duck extends Animal implements IFly,IRun,ISwim{

    public Duck(*//*String name*//*) {
        *//*super(name);
        super.name = name;*//*
    }

    @Override
    public void fly() {
        System.out.println(this.name + "fly");
    }

    @Override
    public void run() {
        System.out.println(name + "run");
    }

    @Override
    public void swim() {
        System.out.println(name + "swim");
    }
}*/

import com.sun.org.glassfish.gmbal.ManagedObjectManager;
import com.sun.scenario.effect.impl.sw.sse.SSEBlend_SRC_OUTPeer;

import java.lang.ref.SoftReference;
import java.sql.SQLOutput;
import java.util.Arrays;
import java.util.Comparator;
import java.util.Objects;

/*class Student implements Comparable<Student>{
    String name;
    int age;
    int score;

    public Student(String name, int age, int score) {
        this.name = name;
        this.age = age;
        this.score = score;
    }

    @Override
    public int compareTo(Student o) {
        //return this.age-o.age;
        //return this.name.compareTo(o.name);
        return this.score-o.score;
    }

    @Override
    public String toString() {
        return "Student{" +
                "name='" + name + '\'' +
                ", age=" + age +
                ", score=" + score +
                '}';
    }
}*/
/*class Student{
    String name;
    int age;
    double score;

    public Student(String name, int age, int score) {
        this.name = name;
        this.age = age;
        this.score = score;
    }
    @Override
    public String toString() {
        return "Student{" +
                "name='" + name + '\'' +
                ", age=" + age +
                ", score=" + score +
                '}';
    }
}
//Comparator<Student> 比较器
class StringCom implements Comparator<Student>{

    @Override
    public int compare(Student o1, Student o2) {
        return o1.name.compareTo(o2.name);
    }
}
class AgeCom implements Comparator<Student>{

    @Override
    public int compare(Student o1, Student o2) {
        return o1.age-o2.age;
    }
}
class ScoreCom implements Comparator<Student>{

    @Override
    public int compare(Student o1, Student o2) {
        return (int)(o1.score-o2.score);
    }
}*/
/*abstract class aaa{
    public void aaa1(){
        System.out.println("fff");
    }

        }
interface bbb{
    void aaa1();
        }
class Money implements Cloneable{
    public int m = 10;
    @Override
    protected Object clone() throws CloneNotSupportedException {
        return super.clone();
    }
}
class Student implements Cloneable{
    public int id = 1234;
    Money money = new Money();

    @Override
    protected Object clone() throws CloneNotSupportedException {
        Student student = (Student)super.clone();
        student.money = (Money)this.money.clone();
        return student;
    }
}*/
class Student{
    String name;
    int age;

    public Student(String name, int age) {
        this.name = name;
        this.age = age;
    }

    @Override
    public String toString() {
        return "Student{" +
                "name='" + name + '\'' +
                ", age=" + age +
                '}';
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        Student student = (Student) o;
        return age == student.age && Objects.equals(name, student.name);
    }

    @Override
    public int hashCode() {
        return Objects.hash(name, age);

    }
}
public class People {
    public static void main(String[] args) {
        Student student = new Student("abc",18);
        Student student1 = new Student("abc",18);
        System.out.println(student.equals(student1));
    }
   /* public static void main(String[] args) throws CloneNotSupportedException {
        Student student = new Student();
        Student student1 = (Student)student.clone();
        System.out.println(student.money.m);
        System.out.println(student1.money.m);
        student1.money.m = 99;
        System.out.println(student.money.m);
        System.out.println(student1.money.m);
    }*/

    /*public static void main(String[] args) {
        Student[] students = new Student[3];
        students[0] = new Student("ahangsan",13,99);
        students[1] = new Student("bisi",23,95);
        students[2] = new Student("cangwu",8,69);
        StringCom stringCom = new StringCom();
        Arrays.sort(students,stringCom);
        System.out.println(Arrays.toString(students));
        AgeCom ageCom = new AgeCom();
        Arrays.sort(students,ageCom);
        System.out.println(Arrays.toString(students));
        ScoreCom scoreCom = new ScoreCom();
        Arrays.sort(students,scoreCom);
        System.out.println(Arrays.toString(students));
    }*/


    /*public static void main(String[] args) {
        Animal duck1 = new Duck();
        duck1.setName("HAHA");
        IFly duck2 = new Duck();
        IRun duck3 = new Duck();
        ISwim duck4 = new Duck();
        duck1.eat();
        duck2.fly();
        duck3.run();
        duck4.swim();
    }*/


//    animal.eat("haha")

    /*public static void main(String[] args) {
        Usb usb1 = new A();
        Usb usb2 = new B();
        usb1.usb();
        usb2.usb();
    }*/
}
